Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing framework and non-geometric parameterisation methods #20

Merged
merged 18 commits into from
Aug 18, 2023

Conversation

BradyPlanden
Copy link
Member

@BradyPlanden BradyPlanden commented Aug 16, 2023

This PR adds the following:

  • A testing framework built with nox & pytest for python versions 3.8 to 3.11
  • Initial tests for the Parameterisation class
  • Updates the Parameterisation class for non-geometric parameter optimisation as per How to handle structural parameters #18
    • This builds the pybamm solver to include the fitting parameters as solver inputs. The next steps for this are outlined in How to handle structural parameters #18, but include building methods to handle geometric parameters.
  • Adds a parameter set class for application on construction of the parameterisation object

Closes #21

Copy link
Contributor

@martinjrobins martinjrobins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BradyPlanden, this is a great start. i've made a bunch of suggestions, but at this early stage there is no need to fix them all before you merge, just something to keep in mind as you develop.

examples/Initial_API.py Outdated Show resolved Hide resolved
examples/Initial_API.py Outdated Show resolved Hide resolved
pybop/parameterisation.py Outdated Show resolved Hide resolved
pybop/parameterisation.py Outdated Show resolved Hide resolved
pybop/parameterisation.py Outdated Show resolved Hide resolved
pybop/parameterisation.py Outdated Show resolved Hide resolved
pybop/parameterisation.py Outdated Show resolved Hide resolved
pybop/parameterisation.py Show resolved Hide resolved
class TestParameterisation:
def test_rmse(self):
# Form observations
Measurements = pd.read_csv("examples/Chen_example.csv", comment='#').to_numpy()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using data files can be annoying if you try to run the tests from a different directory. Could we just generate some simulation data on the fly instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair shout, this should be pretty easy to solve via importing pybamm and grabbing sample data from modified parameter simulation object.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try not to assume you are using pybamm too widely. simulating from a model will be a pretty common thing to do, so it might be useful to have the funcionality in the model class (or if it doesn't fit there a separate Simulation or Solver class)

@BradyPlanden BradyPlanden merged commit 3b77733 into develop Aug 18, 2023
@BradyPlanden BradyPlanden deleted the test_framework_model_methods branch August 18, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add testing framework
2 participants